package com.muyu.system.service.impl;


import com.muyu.common.core.utils.DateUtils;
import com.muyu.system.domain.DanmoShoppingReviewsPicture;
import com.muyu.system.mapper.DanmoShoppingReviewsPictureMapper;
import com.muyu.system.service.IDanmoShoppingReviewsPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评论图片Service业务层处理
 *
 * @author yangle
 * @date 2024-09-29
 */
@Service
public class DanmoShoppingReviewsPictureServiceImpl implements IDanmoShoppingReviewsPictureService
{
    @Autowired
    private DanmoShoppingReviewsPictureMapper danmoShoppingReviewsPictureMapper;

    /**
     * 查询评论图片
     *
     * @param id 评论图片主键
     * @return 评论图片
     */
    @Override
    public DanmoShoppingReviewsPicture selectDanmoShoppingReviewsPictureById(Long id)
    {
        return danmoShoppingReviewsPictureMapper.selectDanmoShoppingReviewsPictureById(id);
    }

    /**
     * 查询评论图片列表
     *
     * @param danmoShoppingReviewsPicture 评论图片
     * @return 评论图片
     */
    @Override
    public List<DanmoShoppingReviewsPicture> selectDanmoShoppingReviewsPictureList(DanmoShoppingReviewsPicture danmoShoppingReviewsPicture)
    {
        return danmoShoppingReviewsPictureMapper.selectDanmoShoppingReviewsPictureList(danmoShoppingReviewsPicture);
    }

    /**
     * 新增评论图片
     *
     * @param danmoShoppingReviewsPicture 评论图片
     * @return 结果
     */
    @Override
    public int insertDanmoShoppingReviewsPicture(DanmoShoppingReviewsPicture danmoShoppingReviewsPicture)
    {
        danmoShoppingReviewsPicture.setCreateTime(DateUtils.getNowDate());
        return danmoShoppingReviewsPictureMapper.insertDanmoShoppingReviewsPicture(danmoShoppingReviewsPicture);
    }

    /**
     * 修改评论图片
     *
     * @param danmoShoppingReviewsPicture 评论图片
     * @return 结果
     */
    @Override
    public int updateDanmoShoppingReviewsPicture(DanmoShoppingReviewsPicture danmoShoppingReviewsPicture)
    {
        danmoShoppingReviewsPicture.setUpdateTime(DateUtils.getNowDate());
        return danmoShoppingReviewsPictureMapper.updateDanmoShoppingReviewsPicture(danmoShoppingReviewsPicture);
    }

    /**
     * 批量删除评论图片
     *
     * @param ids 需要删除的评论图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingReviewsPictureByIds(Long[] ids)
    {
        return danmoShoppingReviewsPictureMapper.deleteDanmoShoppingReviewsPictureByIds(ids);
    }

    /**
     * 删除评论图片信息
     *
     * @param id 评论图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingReviewsPictureById(Long id)
    {
        return danmoShoppingReviewsPictureMapper.deleteDanmoShoppingReviewsPictureById(id);
    }
}
